Skip to content

ENG-1136: Notify user when suggestive mode suggestion is adopted (Roam)#1145

Open
trangdoan982 wants to merge 4 commits into
mainfrom
eng-1136-notify-user-when-suggestive-mode-suggested-node-is-added-to
Open

ENG-1136: Notify user when suggestive mode suggestion is adopted (Roam)#1145
trangdoan982 wants to merge 4 commits into
mainfrom
eng-1136-notify-user-when-suggestive-mode-suggested-node-is-added-to

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

When a user adopts a suggestion in Suggestive Mode (Roam), they now receive clear feedback about where the content was added:

  • Target page open in main window: nothing
  • disableSidebarOpen setting enabled → shows the same toast instead of opening the sidebar
  • Target page already in sidebar → brings the existing sidebar window to the top
  • Otherwise → opens the target page in the right sidebar

For reified relation adoptions (when Stored Relations are enabled), a toast confirms the relation was created: Added relation between [[Source]] and [[Destination]].

Changes

  • apps/roam/src/utils/notifySuggestiveModeAdoption.ts (new) — encapsulates all notification logic; keeps SuggestionsBody focused on block creation
  • apps/roam/src/components/SuggestionsBody.tsx — wires notifySuggestiveModeAdopted into handleCreateBlock; also fixes a pre-existing bug where the "Could not identify a relevant relation" toast was shown but execution continued instead of returning early

Test plan

  • Suggestive Mode: adopt a suggestion while the target page is open in the main window → toast appears
  • Suggestive Mode: adopt a suggestion while the target page is not open → page opens in right sidebar
  • Suggestive Mode: adopt a suggestion while the target page is already in the sidebar → sidebar window comes to the top
  • With disableSidebarOpen enabled: adopt a suggestion → toast appears regardless of sidebar state
  • With Stored Relations enabled: adopt a suggestion → relation toast appears (no sidebar navigation)

Made with Cursor


Open in Devin Review

When a user adopts a suggestion in Suggestive Mode:
- Shows a toast "Added to [[Page Name]]" if the target page is already open in the main window or if sidebar navigation is disabled
- Opens the target page in the right sidebar (or brings it to the top if already open) otherwise
- Shows a toast confirming the created relation when a reified relation is adopted instead of a block

Adds a new `notifySuggestiveModeAdoption` utility to keep notification logic separate from `SuggestionsBody`.

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear-code

linear-code Bot commented Jun 22, 2026

Copy link
Copy Markdown

ENG-1136

@supabase

supabase Bot commented Jun 22, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jun 22, 2026 12:47pm

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread apps/roam/src/components/SuggestionsBody.tsx Outdated
Comment thread apps/roam/src/utils/notifySuggestiveModeAdoption.ts Outdated
Only add notifySuggestiveModeAdopted at the end of the success path;
don't restructure the existing if/else branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/roam/src/utils/notifySuggestiveModeAdoption.ts Outdated
- Replace "adopted/adoption" naming with "added" throughout
- Split single export with discriminated union into two direct functions:
  notifyBlockSuggestionAdded and notifyRelationSuggestionAdded
- Inline one-off helpers: getSidebarWindows, findOutlineSidebarWindowId,
  resolveTargetPageUid
- Merge bringSidebarWindowToTop + focusTopSidebarOutline into one
  focusSidebarOutline(windowId?, delayMs?), removing the buggy global
  fallback selector when a specific windowId is targeted
- Share a single showSuggestionToast for both toast paths

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant